//package com.woniuxy.threeproject.end_water_project_user.controller;
//
//
//import com.woniuxy.threeproject.end_water_project_user.commons.AccountAndWaterMeter;
//import com.woniuxy.threeproject.end_water_project_user.commons.Result;
//import com.woniuxy.threeproject.end_water_project_user.domain.Account;
//import com.woniuxy.threeproject.end_water_project_user.domain.Employee;
//import com.woniuxy.threeproject.end_water_project_user.domain.User;
//import com.woniuxy.threeproject.end_water_project_user.domain.Watermeter;
//import com.woniuxy.threeproject.end_water_project_user.service.IAccountService;
//import com.woniuxy.threeproject.end_water_project_user.service.IEmployeeService;
//import com.woniuxy.threeproject.end_water_project_user.service.IUserService;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.web.bind.annotation.CrossOrigin;
//import org.springframework.web.bind.annotation.RequestMapping;
//
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.annotation.Resource;
//import java.nio.file.WatchService;
//
///**
// * <p>
// * 员工表 前端控制器
// * </p>
// *
// * @author Lucas
// * @since 2021-08-25
// */
//@RestController
//@RequestMapping("/employee")
//@Slf4j
//@CrossOrigin("*")
//public class EmployeeController {
//    @Resource
//    public IEmployeeService iEmployeeService;
//    @Resource
//    public IAccountService accountService;
//    @Resource
//    public WatchService watchService;
//    @Resource
//    public IUserService userService;
//// 加入表之前自动新增账户表
//    public Result addEployee(String name,String address,String idCard,Long phone,Integer age,String gender){
//    //新增账户表
//        Account ac = AccountAndWaterMeter.getAccount();
//        Account reac = accountService.addAccount(ac);
//        if(null!=reac){
//            log.info("新增员工时后台添加账户表成功！");
//        }else{
//            return  Result.fail("4012","新增员工时后台添加账户表失败！");
//        }
//        //新增水表
//        Watermeter rewater = AccountAndWaterMeter.getWaterMeter();
//        if(null!=rewater) {
//            log.info("新增员工时，后台添加水表成功！");
//
//        }else{
//            return  Result.fail("4013","新增员工时，后台添加水表失败！");
//        }
//        //新增用户表
//        User reuer = AccountAndWaterMeter.getUser(name, address, idCard, phone);
//        reuer.setAccountId(ac.getAccountId());
//        reuer.setWaterMeterId(rewater.getWaterMeterId());
//        if(null!=reuer){
//            log.info("新增员工时，后台添加用户表成功！");
//        }else{
//            return  Result.fail("4014","新增员工时，后台添加用户表失败！");
//        }
//        //新增员工表
//        Employee e = new Employee();
//        e.setAccountId(reac.getAccountId());
//        e.setEmployeeAge(age);
//        e.setEmployeeGender(gender);
//        e.setEmployeeName(name);
//        e.setEmployeePhone(phone);
//       Employee re= iEmployeeService.addEmploy(e);
//       if(re!=null){
//           log.info("后台添加员工成功！");
//           return  Result.fail("200","添加员工成功！");
//       }else{
//           log.info("后台添加员工失败！");
//           return Result.fail("4015","添加员工失败！");
//       }
//    }
//
//
//
//}
//
